<?php

class Application_Form_Login extends Zend_Form
{
    public function init()
    {
        /**
         * Definições para o FORM
         */
        $this->setName( 'login' )
	        ->setAction( '/login' )
	        ->setMethod( 'post' )
	        ->setAttrib( 'enctype', 'multipart/form-data' )
	        ->setAttrib( 'id', 'form-login' );
        
        /**
         * Elementos do formulário
         */
        
        $login = new Zend_Form_Element_Text( 'login' );
        $login->setAttrib( 'placeholder', 'login' )
        	->setAttrib("class", "form-control")
        	->setRequired( true )
            ->addValidator('NotEmpty')
            ->addFilter( 'StripTags' )
            ->addFilter( 'StringTrim' )
            ->addErrorMessage('Informe o seu usuario');               
        
        $senha = new Zend_Form_Element_Password( 'senha' );
        $senha->setAttrib( 'placeholder', 'senha' )
	        ->setAttrib("class", "form-control")
	        ->setRequired( true )
	        ->addValidator( 'NotEmpty' )
	        ->addFilter( 'StripTags' )
	        ->addErrorMessage('Informe sua senha');
        
        $submit = new Zend_Form_Element_Submit( 'submit' );
        $submit->setLabel( 'logar' )
        	->setAttrib("class", "btn btn-lg btn-primary btn-block");
        
        $this->addElements(
            array(
                $login,
                $senha,
                $submit
            )
        );

    }
}